import xmlrpclib
import random
from SimpleXMLRPCServer import SimpleXMLRPCServer
def getData():
    return random.randint(0,1);
server=SimpleXMLRPCServer(("localhost",8000))
print ("Listening on port 8000...")
server.register_function(getData,"getData")
server.serve_forever()
